package net.pojoin.operation;

/**
 * 创建计算操作类的简单工厂
 * @author pojoin
 *
 */
public class OperationFactory {

	public static Operation createOperation(String operate){
		if("+".equals(operate)){
			return new OperationAdd();
		}else if("-".equals(operate)){
			return new OperationSub();
		}else if("*".equals(operate)){
			return new OperationMul();
		}else if("/".equals(operate)){
			return new OperationDiv();
		}
		return null;
	}
}
